import _forIn from "lodash/forIn";
import Cookies from 'universal-cookie';
var cookies = new Cookies();
/**
 * 存储sessionStorage
 */

export function setSession(key, value) {
  var formatValue = JSON.stringify(value);
  window.sessionStorage.setItem(key, formatValue);
  return true;
}
/**
 * 获取sessionStorage
 */

export function getSession(key) {
  var value = sessionStorage.getItem(key);

  if (value) {
    return JSON.parse(value);
  }

  return false;
}
export function removeAllCookie() {
  _forIn(cookies.getAll(), function (_, key) {
    cookies.remove(key);
  });
}